Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to include ffprobe #61

Closed
wants to merge 1 commit into from

Conversation

marcello3d
Copy link

  • rename from ffmpeg-static to ffmpeg-ffprobe-static
  • update index.js to export both ffmpegPath and ffprobePath
  • add index.d.ts for TypeScript
  • do not download if the file is already downloaded
  • unzip both ffmpeg and ffprobe to bin/ffmpeg-* and bin/ffprobe-*
  • add darwin ffprobe download (separate zip)
  • update github workflow to upload ffmpeg/ffprobe files with new names
  • add github workflow for running test (instead of travis)
  • fix tar commands on macos (hope it doesn't break linux)
  • add ffprobe tests

- rename from ffmpeg-static to ffmpeg-ffprobe-static
- update index.js to export both ffmpegPath and ffprobePath
- add index.d.ts for TypeScript
- do not download if the file is already downloaded
- unzip both ffmpeg and ffprobe to bin/ffmpeg-* and bin/ffprobe-*
- add darwin ffprobe download (separate zip)
- update github workflow to upload ffmpeg/ffprobe files with new names
- add github workflow for running test (instead of travis)
- fix tar commands on macos (hope it doesn't break linux)
- add ffprobe tests
@marcello3d marcello3d closed this Sep 10, 2020
if [ $? -ne 0 ]; then
tar_exec=$(command -v tar)
fi
set -e
echo using tar executable at $tar_exec

download () {
curl -L -# --compressed -A 'https://github.com/eugeneware/ffmpeg-static' -o $2 $1
if [ -e $2 ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd only accept a logic that does not download again, if it compares Last-Modified or ETag to make sure there isn't a new/different binary available.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, I'll probably take this code out since I was just using it to test locally without downloading each time :)

.then(() => {
fs.chmodSync(ffmpegPath, 0o755) // make executable
})
.catch(exitOnError)
downloadFile(ffprobeUrl, ffprobePath, onProgress)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run these sequentially.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! do you prefer sequentially or in parallel?

@@ -1,8 +1,9 @@
{
"name": "ffmpeg-static",
"name": "ffmpeg-ffprobe-static",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep ffmpeg-static as a name, because a) it is already a known name, and b) the name "ffmpeg" is arguably a lot more well-known than "ffprobe".

Copy link
Collaborator

@derhuerst derhuerst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this PR looks good! I commented on a few issues.

@derhuerst derhuerst added the breaking breaking change label Sep 10, 2020
@marcello3d
Copy link
Author

@derhuerst hello! sorry I prematurely made the PR against this repo (github default).

I'm still testing things out in the fork right now (some of these changes were just so that I could test locally on my mac)

Is this something you'd like to merge in? It roughly doubles the size of the package, and is a breaking API change (since I need to export two paths).

@derhuerst
Copy link
Collaborator

It roughly doubles the size of the package

Yeah, that's the only major headache I have with this change. On macOS, this doubles the installation size and traffic from ~70mb to ~140mb.

@marcello3d
Copy link
Author

So there's another project we've been using ffprobe-static, but it hasn't been updated in a while and bundles all the platform binaries (instead of downloading).

I also published ffmpeg-ffprobe-static as a separate package which has both as in this PR.

I could imagine a lerna workspaces thing where a single github release has all the binaries, but separate npm packages are published that each only download the one binary. Not sure if there's a more lightweight to do two packages in one repo.

@derhuerst
Copy link
Collaborator

I could imagine a lerna workspaces thing where a single github release has all the binaries, but separate npm packages are published that each only download the one binary. Not sure if there's a more lightweight to do two packages in one repo.

There is a more lightweight way! Lerna is basically an agreed-upon and (for 2 packages IMO) over-engineered way to do it.

@mifi
Copy link

mifi commented Dec 10, 2020

Thanks a lot for your work on adding ffprobe @marcello3d
There is afaik no other npm package containing updated (4.3.1) ffprobe except your ffmpeg-ffprobe-static. I will now be using that package instead of the unmaintained https://github.com/joshwnj/ffprobe-static
Any chance that this could be merged into ffmpeg-static or will you continue to maintain your package as a separate package @marcello3d ?

@derhuerst
Copy link
Collaborator

Any chance that this could be merged into ffmpeg-static […]?

Yes, see #19 (comment) .

@marcello3d
Copy link
Author

@mifi we're maintaining it for the near future, although we're migrating to using shared libraries (packaged in the same folder) so that the total size is much smaller. So I'm not sure if the name will still be applicable. :-)

@mifi
Copy link

mifi commented Dec 11, 2020

Ok @marcello3d
My app losslesscut is now using your package ffmpeg-ffprobe-static because I'm lazy to implement this myself now and I wantto use ffprobe 4.3.1. If you stop maintaining it, then I'm happy to take over.
Even better of course if someone implements this inside ffmpeg-static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants